package com.airsystem.pos.bengkel.model.dialog;

import java.awt.GridBagLayout;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

import com.airsystem.pos.bengkel.component.DialogFrame;
import com.airsystem.pos.bengkel.entity.DetailKendaraan;

/**
 * @author Budi Oktaviyan <budi.oktaviyan@icloud.com>
 */
public class MasterVehicleDialogModel extends DialogFrame {
	protected int row = 0;

	protected GridBagLayout baseLayout = new GridBagLayout();
	protected GridBagLayout tableLayout = new GridBagLayout();

	protected JPanel basePanel = new JPanel();
	protected JPanel tablePanel = new JPanel();

	protected JScrollPane tableScroll = new JScrollPane();

	protected JTable tableData = new JTable();

	protected JLabel searchLabel = new JLabel();

	protected JComboBox searchCombo = new JComboBox();

	protected JTextField searchField = new JTextField();

	protected JButton searchButton = new JButton();

	protected DefaultTableModel tableModel = new DefaultTableModel(new Object[][] {},
																   new String[] { "Merk Kendaraan", "Sub Merk Kendaraan" }) {

		boolean[] canEdit = new boolean[] { false, false };

		public boolean isCellEditable(int rowIndex, int columnIndex) {
			return canEdit[columnIndex];
		}
	};

	private String merk;

	private List<DetailKendaraan> subMerk;

	/**
	 * Contains submerk chosen by user. Used on MasterSparepart.
	 * <br>
	 * @author Fanny Irawan Sutawanir (fannyirawans@gmail.com)
	 */
	private String chosenSubMerk;

	public MasterVehicleDialogModel() {
		super();
	}

	public String getMerk() {
		return merk;
	}

	public void setMerk(String merk) {
		this.merk = merk;
	}

	public List<DetailKendaraan> getSubMerk() {
		return subMerk;
	}

	public void setSubMerk(List<DetailKendaraan> subMerk) {
		this.subMerk = subMerk;
	}

	public String getChosenSubMerk() {
		return chosenSubMerk;
	}

	public void setChosenSubMerk(String chosenSubMerk) {
		this.chosenSubMerk = chosenSubMerk;
	}
}